﻿@page
@model Senparc.Xncf.Instraller.Pages.IndexModel
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>NCF 安装 v @Senparc.Ncf.Core.Config.SiteConfig.VERSION</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--css-->
    <link href="~/lib/element-ui_2.13.2/element.css" rel="stylesheet" />
    <link href="~/css/Installer/Pages/index.css" rel="stylesheet" />
</head>
<body>
    <div id="app">
        @switch (Model.Step)
        {
            case 0:
                <div id="install_start" class="center_content">
                    <!-- 安装启动时 -->
                    <div id="install_start_main">
                        <div class="logo">
                            <img src="~/images/logo-login-ncf.png" />
                        </div>
                        <p class="install_notice">检测到系统未初始化，请进行安装！</p>
                        <p class="install_notice">当前数据库：@Model.MultipleDatabaseType</p>
                        <p class="install_notice">
                            多租户状态：@(Model.MultiTenantEnable ? "开启" : "关闭")
                            @if (Model.MultiTenantEnable)
                            {
                                <text>，规则：@Model.TenantRule</text>
                            }
                        </p>
                        <form method="post" id="install_main_form">
                            <a v-on:click="submit" class="option_block" id="btnInstall">立即安装</a>
                        </form>
                        <el-button type="text" v-on:click="toggleInfo" id="btnOptions">
                            高级选项
                            <i class="el-icon-arrow-right el-icon--right" v-if="!isExpanded"></i>
                            <i class="el-icon-arrow-left el-icon--left" v-if="isExpanded"></i>
                        </el-button>

                        <p class="install_notice red">注意：安装完成后此页面将失效！</p>
                    </div>
                    <!-- 展开高级选项时 -->
                    <div class="vertical-line" v-if="isExpanded">
                    </div>
                    <div id="install_start_expand" v-if="isExpanded">
                        <el-form label-width="300px" label-position="top" id="advanced_options">
                            <el-form-item label="系统名称" :disabled="installStarted" required>
                                <el-input v-model="installOptions.systemName"></el-input>
                            </el-form-item>
                            <el-form-item label="管理员名称" :disabled="installStarted" required>
                                <el-input v-model="installOptions.adminUserName"></el-input>
                            </el-form-item>
                            <el-form-item label="数据库连接字符串(修改后需重启项目)" :disabled="installStarted" required>
                                <el-input type="textarea" v-model="installOptions.dbConnectionString" :autosize="{ minRows: 2, maxRows: 6}"></el-input>
                            </el-form-item>
                        </el-form>
                    </div>
                </div>
                break;
            case 1:
                <!-- 安装成功时 -->
                <div id="install_success">
                    <h2>NeuCharFramework<br />初始化安装成功！</h2>
                    <div id="install_success_info">
                        <div>
                            @if (Model.MultiTenantEnable)
                            {
                                <p>
                                    当前租户已创建，名称：<strong>@Model.TenantInfoDto.Name</strong>，
                                    匹配规则：<strong>@Model.TenantRule</strong>，
                                    关键匹配条件：<strong>@Model.TenantInfoDto.TenantKey</strong>
                                </p>
                            }
                            <p>&nbsp;</p>
                            <p>请保存好以下信息：</p>
                            <p>管理员账号：<strong>@Model.AdminUserName</strong></p>
                            <p>管理员密码：<strong>@Model.AdminPassword</strong></p>

                            <p>注意：本页面已经失效，请保存好管理员账号及密码，密码无法找回明文！</p>
                            <p class="center">&gt; <a @*asp-page="/Index" asp-area="Admin"*@ href="/Admin" target="_blank">点击这里登录管理员后台</a> &lt;</p>
                        </div>
                    </div>
                </div>
                break;
            default:
                break;
        }
        <div id="footer">
            苏州盛派网络科技有限公司 版权所有
        </div>
    </div>
    <!--lib-->
    <script src="~/lib/vue/vue.js"></script>
    <script src="~/lib/element-ui_2.13.2/element.js"></script>
    <script src="~/lib/axios/axios.min.js"></script>
    <!--js-->
    <script src="~/js/Installer/Pages/index.js"></script>
</body>
</html>

